CC = gcc
OPT = 
LIBS = -lpcap
MODULES = main
OBJS := $(addsuffix .o, $(MODULES))
HEADERS := $(addsuffix .h, $(MODULES))
CFLAGS = -ggdb -Wall -D_FILE_OFFSET_BITS=64 -std=gnu99
BINARY = bpf_counter

.PHONY: all clean remake

all: $(BINARY)

$(BINARY): $(OBJS)
	$(CC) $(OPT) $(CFLAGS) $(OBJS) -o $(BINARY) $(LIBS)

%.o: %.c $(HEADERS)
	$(CC) $(OPT) $(CFLAGS) -c $< -o $@

clean:
	clear
	$(RM) core
	$(RM) $(OBJS)
	$(RM) $(BINARY)

remake: clean all
